<template>
  <div class="header">
    <div class="header-left">
      <i class="iconfont icon-fanhui"></i>
    </div>
    <div class="header-input">
      <i class="iconfont icon-sousuo"></i>
      输入城市/景点/游玩主题
    </div>
    <router-link to="/city">
      <div class="header-right">{{this.city}}
        <i class="iconfont icon-jiantou"></i>
      </div>
    </router-link>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'HomeHeader',
  data () {
    return {

    }
  },
  computed: {
    ...mapState(['city'])
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<!--lang="stylus"表示用stylus编写css样式-->
<style lang="stylus" scoped>
  @import '~styles/varibles.styl'
  .header
    line-height:$headerHeight
    background: $bgColor
    color: #ffffff
    display: flex
    .header-left
      width: .64rem
      float: left
      text-align: center;
      .icon-fanhui{
        font-size: .4rem;
      }
    .header-input{
      flex: 1
      background: #ffffff
      height: .64rem
      line-height: .64rem;
      margin-left: .2rem
      margin-top: 0.12rem
      padding-left: 0.2rem
      border-radius: .1rem
      color: #ccc
    }
    .header-right {
      color: #ffffff
      min-width: 1.04rem
      padding: 0 .1rem
      float: right
      text-align center
      .icon-jiantou{
        margin-left: -.04rem
        font-size: .24rem
      }
    }

</style>
